package com.yunhe.option.domain.base;

import com.yunhe.common.constant.LanguageConsts;
import com.yunhe.common.i18n.I18nMessageUtil;
import com.yunhe.common.i18n.LanguageHolder;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.neo4j.ogm.annotation.GeneratedValue;
import org.neo4j.ogm.annotation.Id;
import org.neo4j.ogm.annotation.NodeEntity;

import java.io.Serializable;

/**
 * 地区对象
 *
 * @author liuronglei
 * @desc 地区对象定义
 */
@ApiModel(value = "Area", description = "地区对象")
@NodeEntity
public class Area implements Serializable {
    @ApiModelProperty(value = "地区ID")
    @Id
    @GeneratedValue
    private Long id;
    @ApiModelProperty(value = "编号")
    private String name;
    @ApiModelProperty(value = "代码")
    private Long code;
    @ApiModelProperty(value = "标题")
    private String title;
    @ApiModelProperty(value = "地区类型（省市区（县））")
    private String type;
    @ApiModelProperty(value = "二氧化碳减排系数")
    private Double emissionFactor;
    @ApiModelProperty(value = "城市天气代码")
    private Long weatherCode;
    @ApiModelProperty(value = "货币")
    private String currency;

    public Double getEmissionFactor() {
        return emissionFactor;
    }

    public void setEmissionFactor(Double emissionFactor) {
        this.emissionFactor = emissionFactor;
    }

    public Long getCode() {
        return code;
    }

    public void setCode(Long code) {
        this.code = code;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTitle() {
        if (LanguageConsts.TYPE.EN.value().equals(LanguageHolder.getLanguage())) {
            return I18nMessageUtil.getMessage(LanguageHolder.getLanguage(), title);
        } else {
            return title;
        }
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Long getWeatherCode() {
        return weatherCode;
    }

    public void setWeatherCode(Long weatherCode) {
        this.weatherCode = weatherCode;
    }

    public String getCurrency() {
        return currency;
    }

    public void setCurrency(String currency) {
        this.currency = currency;
    }
}
